1. Technical Field
The present invention relates to scheduling of jobs on a computer central processing unit in a multitasking operating environment, and more particularly relates to reducing the time to dispatch of a job having a higher priority for execution than a currently executing job upon a change in status of the higher priority job to "ready-to-run". Still more particularly, the present invention relates to making the time to dispatch of jobs having a time critical priority status both optimal and predictable.
2. Description of the Related Art
First generation personal computer systems handled tasks on a strictly serial basis. In such systems the first task to arrive was the first executed. Early on it was observed that most tasks were characterized by alternating cycles of execution on the computer central processing unit and input/output device waits. Computer system input/output ("I/O") devices are devices such as disk drive units for data storage, keyboards for user inputs, printers and video monitors for display of results. CPU's periodically reach points where, to continue execution of a task, it is necessary to recover data from a disk drive unit or to prompt a user to enter instructions. The period during which such data is waited on is an I/O wait and during this period execution of the task is blocked.
The central processing unit ("CPU") of a computer is its fundamental working element. The CPU interprets and executes instructions. During periods of an I/O wait, the CPU in an early generation personal computer lies idle. Placing other tasks onto the CPU during an I/O wait thus can improve system throughput.
An active task on a computer periodically changes states. A task is ready to run if ready for execution on the CPU. A task has the state of being blocked if, for example, the CPU must wait for an I/O operation to be completed. A task assumes the state of running when memory has been reversed for the task and the task has been dispatched to the CPU. Knowledge of the process states can be utilized to schedule tasks to a CPU allowing the CPU to switch from task to task to improve throughput.
Once scheduling of the CPU becomes available, multiprogrammed operating systems become a possibility. Multiprogramming, sometimes called multitasking, allows utilization of a computer's ("CPU") during what were idle periods in earlier generation computers. In multitasking, the central processing unit is switched between tasks. In its most basic form, several processes are kept in computer memory awaiting access to the central processing unit. When an executing process reaches a point where it requires completion of an I/O device request, the central processing unit is taken away from the executing process, and another waiting process from memory takes its place. In more sophisticated operating systems, a process is not necessarily permitted to hold the microprocessor until it reaches its waiting or blocked state. Numerous criteria may be used to determine when a process is to be removed (interrupted) from the CPU. Other criteria are considered in determining which process to dispatch to the CPU. The benefits of multitasking are that it almost always increases computer system throughput.
Although all computer system resources may be scheduled, scheduling of the CPU is the essential feature of any multitasking operating system. The tasks being scheduled for execution are referred to as concurrently executing processes. The goal of scheduling is to have some task in execution on the CPU at all times.
In the OS/2 operating system available from International Business Machines Corporation, scheduling is a preemptive, general priority system. Tasks are assigned a priority for execution. When tasks are "ready to run", the task having the highest priority generally is executed before any other task. When tasks are of the same priority level for execution, a queue is established for the priority level and execution is alternated on a time-out basis between ready to run tasks in the queue. This is referred to round-robin scheduling.
Among many applications, multitasking has been used to improve the presentation of data to users. For example, an application program such as a game may be loaded onto a computer as one or more processes. The game may use a second program, such as Presentation Manager, available from International Business Machines Corporation, to generate a graphic user interface for presentation of the game to the user. Tasks relating to update of the display will be given a time-critical priority classification to give the user the feel of instantaneous responsiveness. Scorekeeping in such a game may be assigned to regular or to fixed-high priority classes. Of particular importance to the present invention is the treatment of time critical threads, particularly to support real-time applications such as multimedia and process control software.
Prior art data processing systems are known to the art providing user or application selection of schedulers, however, such schedulers are not of automatic and general applicability and frequently require user modification of either the operating system, the application program, or both, to be utilized.